package com.tarena.test.lbs.basic.threadlocal;
//系统通过工具类构造的 save方法存储数据 get方法获取数据 remove方法删除数据
public class NameThreadLocal {
    private static ThreadLocal<String> THREADLOCAL = new ThreadLocal<>();

    //存储数据
    public static void save(String name){
        THREADLOCAL.set(name);
    }
    //获取数据
    public static String get(){
        return THREADLOCAL.get();
    }
    //删除数据
    public static void clear(){
        THREADLOCAL.remove();
    }
}
